function addLoadEvent(func){
	var oldonload = window.onload;
	if (typeof window.onload != 'function'){
		window.onload = func;
	}else{
		window.onload = function(){
			if (oldonload){
				oldonload();
			}
			func();
		}
	}
}

function trim(str){
    return str.replace(/^\s+|\s+$/g,'');
}